﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LCA.Community.DAL.Interfaces
{
    /// <summary>
    /// The interface for base repositories
    /// </summary>
    /// <typeparam name="T">The class that represents the table data.</typeparam>
    public interface IBaseRepository<T>
    {
        /// <summary>
        /// Adds the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        void Add(T entity);
        /// <summary>
        /// Gets the entity with the specified id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns>The entity</returns>
        T Get(string id);
        /// <summary>
        /// Deletes the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        void Delete(T entity);
        /// <summary>
        /// Deletes the entity with the specified id.
        /// </summary>
        /// <param name="id">The id.</param>
        void Delete(string id);
        /// <summary>
        /// Deletes the test entities.
        /// </summary>
        void DeleteTestEntities();
        /// <summary>
        /// Deletes all entities.
        /// </summary>
        void DeleteAllEntities();
        /// <summary>
        /// Updates the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        void Update(T entity);
        /// <summary>
        /// Gets the entities.
        /// </summary>
        /// <value>The entities.</value>
        List<T> Entities { get; }
    }
}
